home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 43.6 KB | 1,654 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Shapes.cpp
- // Release Version: $ 1.0d1 $
- //
- // Author: Henri Lamiraux
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SHAPES_H
- #include "Shapes.h"
- #endif
-
- #ifndef UTILITIES_H
- #include "Utilities.h"
- #endif
-
- #ifndef DRAWPART_H
- #include "DrawPart.h"
- #endif
-
- #ifndef DRAWSELECTION_H
- #include "DrawSelection.h"
- #endif
-
- // ----- Framework Includes -----
- #ifndef FWPROXY_H
- #include "FWProxy.h"
- #endif
-
- #ifndef FWBORDER_H
- #include "FWBorder.h"
- #endif
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- #ifndef FWFACET_H
- #include "FWFacet.h"
- #endif
-
- #ifndef FWSELECT_H
- #include "FWSelect.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- #ifndef FWINK_H
- #include "FWInk.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #ifndef FWLINSHP_H
- #include "FWLinShp.h"
- #endif
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- #ifndef FWRRCSHP_H
- #include "FWRRcShp.h"
- #endif
-
- #ifndef FWOVLSHP_H
- #include "FWOvlShp.h"
- #endif
-
- #ifndef FWSUSTRM_H
- #include "FWSUStrm.h"
- #endif
-
- // ----- OpenDoc Includes
-
- #ifndef _WINDOW_
- #include <Window.h>
- #endif
-
- #ifndef _TRNSFORM_
- #include <Trnsform.h>
- #endif
-
- #ifndef _SHAPE_
- #include <Shape.h>
- #endif
-
- #ifndef _FRAME_
- #include <Frame.h>
- #endif
-
- #ifndef _FACET_
- #include <Facet.h>
- #endif
-
- #ifndef _DRAFT_
- #include <Draft.h>
- #endif
-
- // ----- Macintosh Includes -----
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- #ifndef __DRAG__
- #include <Drag.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- #ifndef mathRoutinesIncludes
- #include <math routines.h> // for ff()
- #endif
-
- #pragma segment drawpart
-
- //==============================================================================
- // class CBaseShape
- //==============================================================================
-
- //-------------------------------------------------------------------------
- // CBaseShape::CBaseShape
- //-------------------------------------------------------------------------
-
- CBaseShape::CBaseShape(short numberOfHandles, unsigned short shapeType) :
- fSelected(FALSE),
- fClipShape(NULL),
- fNumberOfHandles(numberOfHandles),
- fShapeType(shapeType),
- fPublishLink(NULL),
- fSubscribLink(NULL),
- fFrameFill(kFrameOnly),
- fPenInk(FW_kRGBBlack, FW_kRGBWhite, FW_kCopy),
- fBrushInk(FW_kRGBBlack, FW_kRGBWhite, FW_kCopy),
- fPenStyle(ff(1)),
- fBrushStyle(ff(1))
- {
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::~CBaseShape
- //-------------------------------------------------------------------------
-
- CBaseShape::~CBaseShape()
- {
- delete fPublishLink;
- delete fSubscribLink;
-
- delete fClipShape;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::Removed
- //-------------------------------------------------------------------------
-
- void CBaseShape::Removed()
- {
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::Track
- //-------------------------------------------------------------------------
-
- FW_Boolean CBaseShape::Track(FW_CGraphicContext* gc, FW_CStyle trackStyle, const FW_CPoint& anchorPoint, XMPEventData event)
- {
- if (!::WaitMouseMoved(event->where))
- return FALSE;
-
- FW_CInk trackInk(FW_kRGBBlack, FW_kRGBWhite, FW_kXOr);
- SetShapeProperties(FW_kFramed, trackInk, trackStyle);
-
- FW_CPoint currentLoc;
- FW_CPoint prevLoc = anchorPoint;
-
- FW_Boolean stillDown = TRUE;
- FW_Boolean erase = FALSE;
-
- while (stillDown)
- {
- FW_SPlatformPoint qdLoc;
- ::GetMouse(&qdLoc);
- currentLoc = qdLoc;
-
- // ----- Adjust for the size of the cursor
- if (anchorPoint.x < currentLoc.x)
- currentLoc.x += ff(1);
- if (anchorPoint.y < currentLoc.y)
- currentLoc.y += ff(1);
-
- // ----- Test if moved
- if (prevLoc != currentLoc)
- {
- if (erase)
- TrackFeedback(gc, anchorPoint, prevLoc, TRUE); // erase
-
- TrackFeedback(gc, anchorPoint, currentLoc, FALSE); // draw
-
- WaitForTick();
-
- prevLoc = currentLoc;
- erase = TRUE;
- }
-
- stillDown = ::StillDown();
- }
-
- if (erase)
- TrackFeedback(gc, anchorPoint, currentLoc, TRUE); // Erase
-
- ::PenNormal();
-
- return (currentLoc != anchorPoint);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::TrackFeedback
- //-------------------------------------------------------------------------
-
- void CBaseShape::TrackFeedback(FW_CGraphicContext* gc,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& currentPoint,
- FW_Boolean erase)
- {
- if (!erase)
- SetShapeGeometry(anchorPoint, currentPoint);
-
- RenderShape(gc);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::SelectShape
- //-------------------------------------------------------------------------
-
- void CBaseShape::SelectShape(FW_Boolean state)
- {
- fSelected = state;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::ClearCache
- //-------------------------------------------------------------------------
-
- void CBaseShape::ClearCache()
- {
- delete fClipShape;
- fClipShape = NULL;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::DrawShapeHandles
- //-------------------------------------------------------------------------
-
- void CBaseShape::DrawShapeHandles(FW_CFacet* facet, FW_Boolean /*turOn*/)
- {
- FW_UNUSED(facet);
-
- for (short i=1; i<=fNumberOfHandles; i++)
- {
- DrawHandle(i);
- }
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::WhichHandle
- //-------------------------------------------------------------------------
-
- short CBaseShape::WhichHandle(FW_CFacet* facet, const FW_CPoint& mouse) const
- {
- FW_UNUSED(facet);
-
- FW_CRect handleRect;
-
- for (short i=1; i<=fNumberOfHandles; i++)
- {
- CalcHandleRect(i, &handleRect);
- if (handleRect.Contains(mouse))
- return i;
- }
-
- return 0;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::CalcHandleRect
- //-------------------------------------------------------------------------
-
- void CBaseShape::CalcHandleRect(short whichHandle, FW_CRect* handleRect) const
- {
- FW_CPoint pt;
- GetHandleCenter(whichHandle, &pt);
- handleRect->Set(pt.x - ff(2), pt.y - ff(2), pt.x + ff(3), pt.y + ff(3));
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::DrawHandle
- //-------------------------------------------------------------------------
-
- void CBaseShape::DrawHandle(short whichHandle)
- {
- FW_CRect handleRect;
- CalcHandleRect(whichHandle, &handleRect);
- FW_SPlatformRect qdRect = handleRect;
- ::InvertRect(&qdRect);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::SetFrameFillStyle
- //-------------------------------------------------------------------------
-
- void CBaseShape::SetFrameFillStyle(unsigned short style)
- {
- ClearCache();
- fFrameFill = style;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::SetPenStyle
- //-------------------------------------------------------------------------
-
- void CBaseShape::SetPenStyle(FW_CStyle penStyle)
- {
- ClearCache();
- fPenStyle = penStyle;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::InSelectionRect
- //-------------------------------------------------------------------------
-
- FW_Boolean CBaseShape::InSelectionRect(const FW_CRect& selectRect) const
- {
- FW_CRect bounds = GetBoundingBox();
-
- return bounds == bounds.Intersects(selectRect);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::Flatten
- //-------------------------------------------------------------------------
-
- void CBaseShape::Flatten(XMPStorageUnit* storage)
- {
- storage->SetValue(sizeof(fShapeType), (XMPValue)&fShapeType);
- storage->SetValue(sizeof(fSelected), (XMPValue)&fSelected);
- storage->SetValue(sizeof(fNumberOfHandles), (XMPValue)&fNumberOfHandles);
-
- FW_CStorageUnitSink sink(storage);
- FW_CWritableStream stream(&sink);
-
- fPenInk->Flatten(stream);
- fBrushInk->Flatten(stream);
- fPenStyle->Flatten(stream);
- fBrushStyle->Flatten(stream);
-
- storage->SetValue(sizeof(fFrameFill), (XMPValue)&fFrameFill);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::Unflatten
- //-------------------------------------------------------------------------
-
- void CBaseShape::Unflatten(CDrawPart* drawPart, XMPStorageUnit* storage)
- {
- FW_UNUSED(drawPart);
-
- // We don't Unflatten the shape type because it was already read
- // storage->GetValue(sizeof(fShapeType), (XMPValue)&fShapeType);
- storage->GetValue(sizeof(fSelected), (XMPValue)&fSelected);
- storage->GetValue(sizeof(fNumberOfHandles), (XMPValue)&fNumberOfHandles);
-
- FW_CStorageUnitSink sink(storage);
- FW_CReadableStream stream(&sink);
-
- fPenInk->Unflatten(stream);
- fBrushInk->Unflatten(stream);
- fPenStyle->Unflatten(stream);
- fBrushStyle->Unflatten(stream);
-
- storage->GetValue(sizeof(fFrameFill), (XMPValue)&fFrameFill);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::CloneTo
- //-------------------------------------------------------------------------
-
- void CBaseShape::CloneTo(XMPStorageUnit* storageUnit, FW_CFrame* commandFrame, XMPCloneKind cloneKind)
- {
- FW_UNUSED(commandFrame);
- FW_UNUSED(cloneKind);
-
- Flatten(storageUnit);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::CloneFrom
- //-------------------------------------------------------------------------
-
- void CBaseShape::CloneFrom(CDrawPart* drawPart, XMPStorageUnit* storageUnit, XMPCloneKind cloneKind)
- {
- FW_UNUSED(cloneKind);
-
- Unflatten(drawPart, storageUnit);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::MovedAfter
- //-------------------------------------------------------------------------
-
- void CBaseShape::MovedAfter(CBaseShape* shape)
- {
- FW_UNUSED(shape);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::MovedBefore
- //-------------------------------------------------------------------------
-
- void CBaseShape::MovedBefore(CBaseShape* shape)
- {
- FW_UNUSED(shape);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::MovedFirst
- //-------------------------------------------------------------------------
-
- void CBaseShape::MovedFirst()
- {
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::MovedLast
- //-------------------------------------------------------------------------
-
- void CBaseShape::MovedLast()
- {
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::SetFrozen
- //-------------------------------------------------------------------------
-
- FW_Boolean CBaseShape::SetFrozen(FW_Boolean state)
- {
- FW_UNUSED(state);
- return FALSE; // Means I don't care
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::IsFrozen
- //-------------------------------------------------------------------------
-
- FW_Boolean CBaseShape::IsFrozen() const
- {
- return FALSE;
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::GetPenSize
- //-------------------------------------------------------------------------
-
- XMPCoordinate CBaseShape::GetPenSize() const
- {
- return fBaseShape->GetShapeStyle()->GetPenSize();
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::SetShapeProperties
- //-------------------------------------------------------------------------
-
- void CBaseShape::SetShapeProperties(FW_ShapeFills shapeFills, FW_CInk ink, FW_CStyle style)
- {
- fBaseShape->SetShapeInk(ink);
- fBaseShape->SetShapeStyle(style);
- fBaseShape->SetShapeFill(shapeFills);
- }
-
- //-------------------------------------------------------------------------
- // CBaseShape::RenderShape
- //-------------------------------------------------------------------------
-
- void CBaseShape::RenderShape(FW_CGraphicContext* gc)
- {
- fBaseShape->Draw(gc);
- }
-
- //=========================================================================
- // class CLineShape
- //=========================================================================
-
- //-------------------------------------------------------------------------
- // CLineShape::CLineShape
- //-------------------------------------------------------------------------
-
- CLineShape::CLineShape() :
- CBaseShape(2, kLineShape),
- fShape(FW_kZeroPoint, FW_kZeroPoint)
- {
- fBaseShape = fShape;
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::~CLineShape
- //-------------------------------------------------------------------------
-
- CLineShape::~CLineShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::DrawShape
- //-------------------------------------------------------------------------
-
- void CLineShape::DrawShape(FW_CGraphicContext* gc)
- {
- fShape->SetShapeFill(FW_kFramed);
- fShape->SetShapeInk(GetPenInk());
- fShape->SetShapeStyle(GetPenStyle());
- fShape->Draw(gc);
-
- // ----- Remove what I have drawn
- XMPShape* clipShape = ::NewXMPShape();
- gc->GetClipShape(clipShape);
- clipShape->Subtract(GetClipShape(gc));
- gc->SetClipShape(clipShape);
- delete clipShape;
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::OutlineShape
- //-------------------------------------------------------------------------
-
- void CLineShape::OutlineShape(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style,
- const FW_CPoint& pt1, const FW_CPoint& pt2)
- {
- FW_CLineShape lineShape(pt1, pt2);
- lineShape->SetShapeInk(ink);
- lineShape->SetShapeStyle(style);
- lineShape->SetShapeFill(FW_kFramed);
- lineShape->Draw(gc);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::HitTest
- //-------------------------------------------------------------------------
-
- FW_Boolean CLineShape::HitTest(FW_CGraphicContext* gc, const FW_CPoint& mouse, XMPEventData event) const
- {
- FW_UNUSED(event);
- FW_UNUSED(gc);
-
- FW_CRect rect = GetBoundingBox();
- rect.Inset(ff(-2), ff(-2));
-
- FW_CPoint endPoint = GetLineEnd();
- FW_CPoint startPoint = GetLineStart();
-
- FW_Boolean result = FALSE;
-
- if (rect.Contains(mouse))
- {
- XMPCoordinate dx = endPoint.x - startPoint.x;
- XMPCoordinate dy = endPoint.y - startPoint.y;
-
- if (dx == 0) // vertical line
- {
- if ((endPoint.y <= mouse.y && mouse.y <= startPoint.y) ||
- (startPoint.y <= mouse.y && mouse.y <= endPoint.y))
- {
- result = Abs(endPoint.x - mouse.x) < ff(3);
- }
- }
- else if (dy == 0) // horizontal line
- {
- if ((endPoint.x <= mouse.x && mouse.x <= startPoint.x) ||
- (startPoint.x <= mouse.x && mouse.x <= endPoint.x))
- {
- result = Abs(endPoint.y - mouse.y) < ff(3);
- }
- }
- else
- {
- XMPCoordinate a2 = dx * (mouse.y - startPoint.y) - dy * (mouse.x - startPoint.x);
- if (a2<0) a2 *= -1;
-
- if (dx<0) dx *= -1;
- if (dy<0) dy *= -1;
-
- XMPCoordinate v;
- if (dx < dy) v = dx / 2;
- else v = dy / 2;
-
- result = (a2 / (v + dx + dy)) < ff(3);
- }
- }
-
- return result;
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::GetUpdateShape
- //-------------------------------------------------------------------------
-
- void CLineShape::GetUpdateShape(XMPShape* updateShape) const
- {
- FW_CRect rect = GetBoundingBox();
-
- if (IsSelected())
- rect.Inset(ff(-2), ff(-2));
-
- updateShape->SetRectangle(&rect);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::GetBoundingBox
- //-------------------------------------------------------------------------
-
- FW_CRect CLineShape::GetBoundingBox() const
- {
- return fShape->GetShapeBounds();
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::GetClipShape
- //-------------------------------------------------------------------------
-
- XMPShape* CLineShape::GetClipShape(FW_CGraphicContext* gc)
- {
- if (fClipShape == NULL)
- {
- FW_PlatformRegion rgn = ::NewRgn();
- GetDragRgn(gc, rgn);
- fClipShape = ::NewXMPShape(rgn);
- }
-
- return fClipShape;
- }
-
- //-------------------------------------------------------------------------
- // MakeLineRgn
- //-------------------------------------------------------------------------
-
- void MakeLineRgn(FW_SPlatformPoint start, const FW_SPlatformPoint end, short pen)
- {
- ::MoveTo(start.h, start.v);
- ::LineTo(end.h, end.v);
- ::Line(pen, 0);
- ::Line(0, pen);
- ::LineTo(start.h + pen, start.v + pen);
- ::Line(-pen, 0);
- ::Line(0, -pen);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::GetDragRgn
- //-------------------------------------------------------------------------
-
- void CLineShape::GetDragRgn(FW_CGraphicContext* gc, FW_PlatformRegion dragRgn)
- {
- FW_UNUSED(gc);
-
- XMPCoordinate penSize = GetPenSize();
-
- FW_CPoint endPoint = GetLineEnd();
- FW_CPoint startPoint = GetLineStart();
- FW_SPlatformPoint start = startPoint;
- FW_SPlatformPoint end = endPoint;
- short pen = FixedToInt(penSize);
-
- ::OpenRgn();
-
- if (endPoint.x < startPoint.x)
- {
- if (endPoint.y < startPoint.y)
- {
- ::MoveTo(start.h + pen, start.v);
- ::LineTo(end.h + pen, end.v);
- ::Line(-pen, 0);
- ::Line(0, pen);
- ::LineTo(start.h, start.v + pen);
- ::Line(-pen, 0);
- ::Line(0, -pen);
- }
- else if (endPoint.y > startPoint.y)
- {
- ::MakeLineRgn(start, end, pen);
- }
- else
- {
- ::MakeLineRgn(start, end, pen);
- }
- }
- else if (endPoint.x > startPoint.x)
- {
- if (endPoint.y < startPoint.y)
- {
- ::MakeLineRgn(start, end, pen);
- }
- else if (endPoint.y > startPoint.y)
- {
- ::MoveTo(start.h, start.v);
- ::Line(pen, 0);
- ::LineTo(end.h + pen, end.v);
- ::Line(0, pen);
- ::Line(-pen, 0);
- ::LineTo(start.h, start.v + pen);
- ::Line(0, -pen);
- }
- else
- {
- ::MakeLineRgn(start, end, pen);
- }
- }
- else
- {
- if (endPoint.y < startPoint.y)
- {
- ::MakeLineRgn(start, end, pen);
- }
- else if (endPoint.y > startPoint.y)
- {
- ::MakeLineRgn(start, end, pen);
- }
- else
- {
- ::MoveTo(start.h, start.v);
- ::Line(pen, 0);
- ::Line(0, pen);
- ::Line(-pen, 0);
- ::Line(0, -pen);
- }
- }
-
- ::CloseRgn(dragRgn);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::GetHandleCenter
- //-------------------------------------------------------------------------
-
- void CLineShape::GetHandleCenter(short whichHandle, FW_CPoint* center) const
- {
- if (whichHandle == 1)
- *center = GetLineStart();
- else
- *center = GetLineEnd();
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::ResizeFeedback
- //-------------------------------------------------------------------------
-
- void CLineShape::ResizeFeedback(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style, const FW_CRect& srcRect, const FW_CRect& dstRect)
- {
- FW_CPoint pt1 = GetLineStart();
- FW_CPoint pt2 = GetLineEnd();
-
- pt1.Map(srcRect, dstRect);
- pt2.Map(srcRect, dstRect);
-
- OutlineShape(gc, ink, style, pt1, pt2);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::MapShape
- //-------------------------------------------------------------------------
-
- void CLineShape::MapShape(const FW_CRect& srcRect, const FW_CRect& dstRect)
- {
- FW_CPoint pt1 = GetLineStart();
- pt1.Map(srcRect, dstRect);
-
- FW_CPoint pt2 = GetLineEnd();
- pt2.Map(srcRect, dstRect);
-
- SetShapeGeometry(pt1, pt2);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::OffsetShape
- //-------------------------------------------------------------------------
-
- void CLineShape::OffsetShape(XMPCoordinate xDelta, XMPCoordinate yDelta)
- {
- ClearCache();
-
- XMPTransform* t = ::NewXMPTransform(FW_CPoint(xDelta, yDelta));
- fShape->Transform(t);
- delete t;
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::SetShapeGeometry
- //-------------------------------------------------------------------------
-
- void CLineShape::SetShapeGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint)
- {
- ClearCache();
-
- fShape->SetLineStart(anchorPoint);
- fShape->SetLineEnd(currentPoint);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::Flatten
- //-------------------------------------------------------------------------
-
- void CLineShape::Flatten(XMPStorageUnit* storage)
- {
- CBaseShape::Flatten(storage);
-
- FW_CPoint p = GetLineStart();
- storage->SetValue(sizeof(p), (XMPValue)&p);
- p = GetLineEnd();
- storage->SetValue(sizeof(p), (XMPValue)&p);
- }
-
- //-------------------------------------------------------------------------
- // CLineShape::Unflatten
- //-------------------------------------------------------------------------
-
- void CLineShape::Unflatten(CDrawPart* drawPart, XMPStorageUnit* storage)
- {
- CBaseShape::Unflatten(drawPart, storage);
-
- FW_CPoint pt1, pt2;
- storage->GetValue(sizeof(pt1), (XMPValue)&pt1);
- storage->GetValue(sizeof(pt2), (XMPValue)&pt2);
-
- SetShapeGeometry(pt1, pt2);
- }
-
- //==============================================================================
- // class CBoundedShape
- //==============================================================================
-
- //-------------------------------------------------------------------------
- // CBoundedShape::CBoundedShape
- //-------------------------------------------------------------------------
-
- CBoundedShape::CBoundedShape(unsigned short shapeType) :
- CBaseShape(4, shapeType),
- fRect(0,0,0,0)
- {
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::~CBoundedShape
- //-------------------------------------------------------------------------
-
- CBoundedShape::~CBoundedShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::DrawShape
- //-------------------------------------------------------------------------
-
- void CBoundedShape::DrawShape(FW_CGraphicContext* gc)
- {
- if (HasFillStyle())
- {
- SetShapeProperties(FW_kFilled, GetBrushInk(), GetBrushStyle());
- RenderShape(gc);
- }
-
- if (HasFrameStyle())
- {
- SetShapeProperties(FW_kFramed, GetPenInk(), GetPenStyle());
- RenderShape(gc);
- }
-
- // ----- Remove what I have drawn
- XMPShape* clipShape = ::NewXMPShape();
- gc->GetClipShape(clipShape);
- clipShape->Subtract(GetClipShape(gc));
- gc->SetClipShape(clipShape);
- delete clipShape;
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::GetUpdateShape
- //-------------------------------------------------------------------------
-
- void CBoundedShape::GetUpdateShape(XMPShape* updateShape) const
- {
- FW_CRect rect = GetBoundingBox();
-
- if (IsSelected())
- rect.Inset(ff(-2), ff(-2));
-
- updateShape->SetRectangle(&rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::GetClipShape
- //-------------------------------------------------------------------------
-
- XMPShape* CBoundedShape::GetClipShape(FW_CGraphicContext* gc)
- {
- if (fClipShape == NULL)
- {
- FW_PlatformRegion rgn = ::NewRgn();
- if (FrameOnly())
- {
- GetDragRgn(gc,rgn);
- }
- else
- {
- FW_CInk ink(FW_kRGBBlack);
- FW_CStyle style(ff(1));
- FW_CRect rect = GetBoundingBox();
- ::OpenRgn();
- OutlineShape(gc, ink, style, rect);
- ::CloseRgn(rgn);
- }
- fClipShape = ::NewXMPShape(rgn);
- }
-
- return fClipShape;
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::GetDragRgn
- //-------------------------------------------------------------------------
-
- void CBoundedShape::GetDragRgn(FW_CGraphicContext* gc, FW_PlatformRegion dragRgn)
- {
- FW_CRect rect = GetBoundingBox();
-
- FW_CInk ink(FW_kRGBBlack);
- FW_CStyle style(ff(1));
-
- ::OpenRgn();
- OutlineShape(gc, ink, style, rect);
- ::CloseRgn(dragRgn);
-
- FW_SPlatformPoint penSize = gc->AsPlatformPoint(FW_CPoint(GetPenSize(), GetPenSize()));
-
- FW_PlatformRegion tempRgn = ::NewRgn();
- ::CopyRgn(dragRgn, tempRgn);
- ::InsetRgn(tempRgn, penSize.h, penSize.v);
- ::DiffRgn(dragRgn, tempRgn, dragRgn);
- ::DisposeRgn(tempRgn);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::GetHandleCenter
- //-------------------------------------------------------------------------
-
- void CBoundedShape::GetHandleCenter(short whichHandle, FW_CPoint* center) const
- {
- FW_CRect rect = GetBoundingBox();
-
- switch (whichHandle)
- {
- case kInTopLeftCorner:
- center->x = rect.left;
- center->y = rect.top;
- break;
- case kInTopRightCorner:
- center->x = rect.right-ff(1);
- center->y = rect.top;
- break;
- case kInBottomLeftCorner:
- center->x = rect.left;
- center->y = rect.bottom-ff(1);
- break;
- case kInBottomRightCorner:
- center->x = rect.right-ff(1);
- center->y = rect.bottom-ff(1);
- break;
- }
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::ResizeFeedback
- //-------------------------------------------------------------------------
-
- void CBoundedShape::ResizeFeedback(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style, const FW_CRect& originalRect, const FW_CRect& mapRect)
- {
- FW_UNUSED(originalRect);
-
- FW_CRect rect(mapRect);
- rect.Sort();
- OutlineShape(gc, ink, style, rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::HitTest
- //-------------------------------------------------------------------------
-
- FW_Boolean CBoundedShape::HitTest(FW_CGraphicContext* gc, const FW_CPoint& mouse, XMPEventData event) const
- {
- FW_UNUSED(event);
- FW_UNUSED(gc);
-
- FW_Boolean result = FALSE;
- FW_CRect rect = GetBoundingBox();
-
- if (HasFillStyle())
- {
- result = rect.Contains(mouse);
- }
- else
- {
- rect.Inset(ff(-2), ff(-2));
- if (rect.Contains(mouse))
- {
- rect.Inset(ff(2) + GetPenSize() + ff(2), ff(2) + GetPenSize() + ff(2));
- result = !rect.Contains(mouse);
- }
- }
-
- return result;
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::MapShape
- //-------------------------------------------------------------------------
-
- void CBoundedShape::MapShape(const FW_CRect& srcRect, const FW_CRect& dstRect)
- {
- FW_CRect rect = GetBoundingBox();
-
- ClearCache();
-
- rect.Map(srcRect, dstRect);
-
- rect.Sort();
-
- XMPCoordinate penSize = GetPenSize();
- if (rect.right == rect.left)
- rect.right = rect.left + penSize;
- if (rect.bottom == rect.top)
- rect.bottom = rect.top + penSize;
-
- SetBoundingBox(rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::OffsetShape
- //-------------------------------------------------------------------------
-
- void CBoundedShape::OffsetShape(XMPCoordinate xDelta, XMPCoordinate yDelta)
- {
- ClearCache();
- FW_CRect rect = GetBoundingBox();
- rect.Offset(xDelta, yDelta);
- SetBoundingBox(rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::SetShapeGeometry
- //-------------------------------------------------------------------------
-
- void CBoundedShape::SetShapeGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint)
- {
- FW_CRect rect = GetBoundingBox();
- CalcRect(anchorPoint, currentPoint, &rect);
- SetBoundingBox(rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::CalcRect
- //-------------------------------------------------------------------------
-
- void CBoundedShape::CalcRect(const FW_CPoint& anchorPoint, const FW_CPoint& endPoint, FW_CRect* rect)
- {
- if (anchorPoint.x < endPoint.x)
- {
- rect->left = anchorPoint.x;
- rect->right = endPoint.x;
- }
- else
- {
- rect->left = endPoint.x;
- rect->right = anchorPoint.x + ff(XMPASLMQDGlobals.thePort->pnSize.h);
- }
-
- if (anchorPoint.y < endPoint.y)
- {
- rect->top = anchorPoint.y;
- rect->bottom = endPoint.y;
- }
- else
- {
- rect->top = endPoint.y;
- rect->bottom = anchorPoint.y + ff(XMPASLMQDGlobals.thePort->pnSize.v);
- }
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::Flatten
- //-------------------------------------------------------------------------
-
- void CBoundedShape::Flatten(XMPStorageUnit* storage)
- {
- CBaseShape::Flatten(storage);
- FW_CRect rect = GetBoundingBox();
- storage->SetValue(sizeof(rect), (XMPValue)&rect);
- }
-
- //-------------------------------------------------------------------------
- // CBoundedShape::Unflatten
- //-------------------------------------------------------------------------
-
- void CBoundedShape::Unflatten(CDrawPart* drawPart, XMPStorageUnit* storage)
- {
- CBaseShape::Unflatten(drawPart, storage);
- FW_CRect rect;
- storage->GetValue(sizeof(rect), (XMPValue)&rect);
- SetBoundingBox(rect);
- }
-
- //==============================================================================
- // class CRectShape
- //==============================================================================
-
- //-------------------------------------------------------------------------
- // CRectShape::CRectShape
- //-------------------------------------------------------------------------
-
- CRectShape::CRectShape() :
- CBoundedShape(kRectShape),
- fShape(FW_kZeroRect)
- {
- fBaseShape = fShape;
- }
-
- //-------------------------------------------------------------------------
- // CRectShape::CRectShape
- //-------------------------------------------------------------------------
-
- CRectShape::CRectShape(unsigned short shapeType) :
- CBoundedShape(shapeType),
- fShape(FW_kZeroRect)
- {
- fBaseShape = fShape;
- }
-
- //-------------------------------------------------------------------------
- // CRectShape::~CRectShape
- //-------------------------------------------------------------------------
-
- CRectShape::~CRectShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // CRectShape::GetBoundingBox
- //-------------------------------------------------------------------------
-
- FW_CRect CRectShape::GetBoundingBox() const
- {
- return fShape->GetShapeBounds();
- }
-
- //-------------------------------------------------------------------------
- // CRectShape::SetBoundingBox
- //-------------------------------------------------------------------------
-
- void CRectShape::SetBoundingBox(const FW_CRect& bounds)
- {
- fShape->SetRectangle(bounds);
- }
-
- //-------------------------------------------------------------------------
- // CRectShape::OutlineShape
- //-------------------------------------------------------------------------
-
- void CRectShape::OutlineShape(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style, const FW_CRect& rect)
- {
- FW_CRectShape rectShape(rect);
- rectShape->SetShapeFill(FW_kFramed);
- rectShape->SetShapeStyle(style);
- rectShape->SetShapeInk(ink);
- rectShape->Draw(gc);
- }
-
- //==============================================================================
- // class COvalShape
- //==============================================================================
-
- //-------------------------------------------------------------------------
- // COvalShape::COvalShape
- //-------------------------------------------------------------------------
-
- COvalShape::COvalShape():
- CBoundedShape(kOvalShape),
- fShape(FW_kZeroRect)
- {
- fBaseShape = fShape;
- }
-
- //-------------------------------------------------------------------------
- // COvalShape::~COvalShape
- //-------------------------------------------------------------------------
-
- COvalShape::~COvalShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // COvalShape::GetBoundingBox
- //-------------------------------------------------------------------------
-
- FW_CRect COvalShape::GetBoundingBox() const
- {
- return fShape->GetShapeBounds();
- }
-
- //-------------------------------------------------------------------------
- // COvalShape::SetBoundingBox
- //-------------------------------------------------------------------------
-
- void COvalShape::SetBoundingBox(const FW_CRect& bounds)
- {
- fShape->SetRectangle(bounds);
- }
-
- //-------------------------------------------------------------------------
- // COvalShape::OutlineShape
- //-------------------------------------------------------------------------
-
- void COvalShape::OutlineShape(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style, const FW_CRect& rect)
- {
- FW_COvalShape ovalShape(rect);
- ovalShape->SetShapeFill(FW_kFramed);
- ovalShape->SetShapeStyle(style);
- ovalShape->SetShapeInk(ink);
- ovalShape->Draw(gc);
- }
-
- //-------------------------------------------------------------------------
- // COvalShape::HitTest
- //-------------------------------------------------------------------------
-
- FW_Boolean COvalShape::HitTest(FW_CGraphicContext* gc, const FW_CPoint& mouse, XMPEventData event) const
- {
- FW_UNUSED(event);
-
- // For now use a region
- FW_Boolean result = FALSE;
-
- FW_CRect rect = GetBoundingBox();
- FW_SPlatformRect qdRect = gc->AsPlatformRect(rect);
-
- ::InsetRect(&qdRect, -2, -2);
-
- FW_PlatformRegion rgn = ::NewRgn();
- ::OpenRgn();
- ::FrameOval(&qdRect);
- ::CloseRgn(rgn);
-
- FW_SPlatformPoint qdMouse = mouse;
- if (::PtInRgn(qdMouse, rgn))
- {
- if (!HasFillStyle())
- {
- FW_SPlatformRect qdRect2 = qdRect;
- ::InsetRect(&qdRect2, 2 + FixedToInt(GetPenSize()) + 2, 2 + FixedToInt(GetPenSize()) + 2);
- ::MapRgn(rgn, &qdRect, &qdRect2);
- result = !::PtInRgn(qdMouse, rgn);
- }
- result = TRUE;
- }
-
- DisposeRgn(rgn);
-
- return result;
- }
-
- //=========================================================================
- // class CRoundRectShape
- //=========================================================================
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::CRoundRectShape
- //-------------------------------------------------------------------------
-
- CRoundRectShape::CRoundRectShape():
- CBoundedShape(kRRectShape),
- fShape(FW_kZeroRect, FW_kZeroPoint)
- {
- fBaseShape = fShape;
- }
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::~CRoundRectShape
- //-------------------------------------------------------------------------
-
- CRoundRectShape::~CRoundRectShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::OutlineShape
- //-------------------------------------------------------------------------
-
- void CRoundRectShape::OutlineShape(FW_CGraphicContext* gc, FW_CInk ink, FW_CStyle style, const FW_CRect& rect)
- {
- FW_CRoundRectShape roundRecShape(rect, fShape->GetOvalSize());
- roundRecShape->SetShapeFill(FW_kFramed);
- roundRecShape->SetShapeStyle(style);
- roundRecShape->SetShapeInk(ink);
- roundRecShape->Draw(gc);
- }
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::GetBoundingBox
- //-------------------------------------------------------------------------
-
- FW_CRect CRoundRectShape::GetBoundingBox() const
- {
- return fShape->GetShapeBounds();
- }
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::SetBoundingBox
- //-------------------------------------------------------------------------
-
- void CRoundRectShape::SetBoundingBox(const FW_CRect& bounds)
- {
- fShape->SetRectangle(bounds);
- }
-
- //-------------------------------------------------------------------------
- // CRoundRectShape::SetShapeGeometry
- //-------------------------------------------------------------------------
-
- void CRoundRectShape::SetShapeGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint)
- {
- CBoundedShape::SetShapeGeometry(anchorPoint, currentPoint);
- fShape->SetOvalSize(FW_CPoint(ff(32), ff(32)));
- }
-
- //=========================================================================
- // class CProxyShape
- //=========================================================================
-
- //-------------------------------------------------------------------------
- // CProxyShape::CProxyShape
- //-------------------------------------------------------------------------
-
- CProxyShape::CProxyShape(const FW_CRect& rect):
- CRectShape(kProxyShape)
- {
- fFrozen = FALSE;
-
- SetBoundingBox(rect);
-
- fProxyRun = NULL;
-
- FW_CStyle style(ff(1));
- SetPenStyle(style);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::CProxyShape
- //-------------------------------------------------------------------------
-
- CProxyShape::CProxyShape():
- CRectShape(kProxyShape)
- {
- fProxyRun = NULL;
- fFrozen = FALSE;
-
- FW_CStyle style(ff(1));
- SetPenStyle(style);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::~CProxyShape
- //-------------------------------------------------------------------------
-
- CProxyShape::~CProxyShape()
- {
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::Removed
- //-------------------------------------------------------------------------
-
- void CProxyShape::Removed()
- {
- CRectShape::Removed();
-
- fProxyRun->GetEmbeddingPart()->RemoveEmbeddedFrames(fProxyRun);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::DrawShape
- //
- // Because there can be multiple of CProxyShape pointing on an embedded
- // frame, I only draw those belonging to this frame.
- //-------------------------------------------------------------------------
-
- void CProxyShape::DrawShape(FW_CGraphicContext* gc)
- {
- XMPShape *clipShape = ::NewXMPShape();
- gc->GetClipShape(clipShape);
-
- XMPShape* tempShape = ::NewXMPShape();
-
- FW_CFacet* theFacet = FW_CFacet::XMPtoFWFacet(gc->GetXMPFacet());
-
- FW_CEmbeddedXMPFacetsIterator ite(fProxyRun,theFacet, kXMPFrontToBack);
- for (XMPFacet *embeddedXMPFacet = ite.First(); ite.IsNotComplete(); embeddedXMPFacet = ite.Next())
- {
- tempShape->CopyFrom(clipShape);
- tempShape->Transform(theFacet->GetFrameTransform()); // Frame -> Window
- tempShape->InverseTransform(embeddedXMPFacet->GetFrameTransform()); // Window -> Frame
-
- embeddedXMPFacet->Draw(tempShape);
- embeddedXMPFacet->DrawChildren(tempShape);
-
- tempShape->CopyFrom(embeddedXMPFacet->GetClipShape());
- tempShape->Transform(embeddedXMPFacet->GetExternalTransform());
- clipShape->Subtract(tempShape);
- }
-
- delete tempShape;
-
- gc->SyncGraphicContext(clipShape);
- delete clipShape;
- }
-
-
- //-------------------------------------------------------------------------
- // CProxyShape::HitTest
- //-------------------------------------------------------------------------
-
- FW_Boolean CProxyShape::HitTest(FW_CGraphicContext* gc, const FW_CPoint& mouse, XMPEventData event) const
- {
- FW_UNUSED(event);
- FW_CFacet* facet = FW_CFacet::XMPtoFWFacet(gc->GetXMPFacet());
- FW_CPoint point = facet->GetWindowContentTransform()->TransformPoint(mouse);
- return fProxyRun->WhichEmbeddedFacet(facet, point) != NULL;
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::MapShape
- //-------------------------------------------------------------------------
-
- void CProxyShape::MapShape(const FW_CRect& srcRect, const FW_CRect& dstRect)
- {
- CRectShape::MapShape(srcRect, dstRect);
-
- XMPShape *shape = ::NewXMPShape(GetBoundingBox());
-
- fProxyRun->ResizeProxyFrames(shape); // shape is kept by the frame
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::OffsetShape
- //-------------------------------------------------------------------------
-
- void CProxyShape::OffsetShape(XMPCoordinate xDelta, XMPCoordinate yDelta)
- {
- CRectShape::OffsetShape(xDelta, yDelta);
-
- FW_CPoint offset(xDelta, yDelta);
-
- fProxyRun->OffsetProxyFrames(offset);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::SelectShape
- //-------------------------------------------------------------------------
-
- void CProxyShape::SelectShape(FW_Boolean state)
- {
- CBaseShape::SelectShape(state);
- fProxyRun->SetSelectState(state);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::Flatten
- //-------------------------------------------------------------------------
-
- void CProxyShape::Flatten(XMPStorageUnit* storage)
- {
- CRectShape::Flatten(storage);
-
- fProxyRun->Externalize(storage);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::Unflatten
- //-------------------------------------------------------------------------
-
- void CProxyShape::Unflatten(CDrawPart* drawPart, XMPStorageUnit* storage)
- {
- CRectShape::Unflatten(drawPart, storage);
-
- fProxyRun = (CDrawProxyRun*)drawPart->NewProxyRun();
- fProxyRun->Internalize(storage);
- fProxyRun->SetShape(this);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::CloneTo
- //-------------------------------------------------------------------------
-
- void CProxyShape::CloneTo(XMPStorageUnit* storageUnit, FW_CFrame* commandFrame, XMPCloneKind cloneKind)
- {
- // I can't call CRectShape::CloneTo because it will call CProxyShape::Flatten
- CRectShape::Flatten(storageUnit);
- fProxyRun->CloneTo(storageUnit, commandFrame, cloneKind);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::CloneFrom
- //-------------------------------------------------------------------------
-
- void CProxyShape::CloneFrom(CDrawPart* drawPart, XMPStorageUnit* storageUnit, XMPCloneKind cloneKind)
- {
- // I can't call CRectShape::CloneFrom because it will call CProxyShape::Unflatten
- CRectShape::Unflatten(drawPart, storageUnit);
-
- CDrawProxyRun* proxyRun = (CDrawProxyRun*)drawPart->NewProxyRun();
-
- // ----- Set the proxyRun of the shape and the shape of the proxyRun -----
- SetProxyRun(proxyRun);
- proxyRun->SetShape(this);
-
- // ----- Clone the proxyRun -----
- XMPFrame* embeddedXMPFrame = proxyRun->CloneFrom(storageUnit, cloneKind);
-
- // ----- Embed the frame -----
- FW_CRect box = GetBoundingBox();
- FW_CPoint ptTemp(box.left, box.top);
- XMPTransform* externalXForm = ::NewXMPTransform(ptTemp);
-
- drawPart->EmbedFrame(embeddedXMPFrame,
- proxyRun,
- drawPart->GetMainPresentation(),
- externalXForm,
- FALSE);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::ProxyShapeChanged
- //-------------------------------------------------------------------------
-
- void CProxyShape::ProxyShapeChanged(const FW_CRect& rect)
- {
- SetBoundingBox(rect);
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::MovedAfter
- //
- // shape has been moved after this
- //-------------------------------------------------------------------------
-
- void CProxyShape::MovedAfter(CBaseShape* shape)
- {
- if (shape->GetShapeType() == kProxyShape)
- {
- ((CProxyShape*)shape)->GetProxyRun()->MoveBehind(GetProxyRun());
- }
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::MovedBefore
- //
- // shape has been moved before this
- //-------------------------------------------------------------------------
-
- void CProxyShape::MovedBefore(CBaseShape* shape)
- {
- if (shape->GetShapeType() == kProxyShape)
- {
- ((CProxyShape*)shape)->GetProxyRun()->MoveBefore(GetProxyRun());
- }
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::MovedFirst
- //
- // this has been moved First
- //-------------------------------------------------------------------------
-
- void CProxyShape::MovedFirst()
- {
- GetProxyRun()->MoveFirst();
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::MovedLast
- //
- // this has been moved Last
- //-------------------------------------------------------------------------
-
- void CProxyShape::MovedLast()
- {
- GetProxyRun()->MoveLast();
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::SetFrozen
- //-------------------------------------------------------------------------
-
- FW_Boolean CProxyShape::SetFrozen(FW_Boolean state)
- {
- if (fFrozen != state)
- {
- fFrozen = state;
- return TRUE;
- }
-
- return FALSE;
- }
-
- //-------------------------------------------------------------------------
- // CProxyShape::IsFrozen
- //-------------------------------------------------------------------------
-
- FW_Boolean CProxyShape::IsFrozen() const
- {
- return fFrozen;
- }
-